﻿@model Core.Models.UserUI

@{
    ViewBag.Title = "Create New";
    Layout = ((Core.Models.Theme)Session["Theme"]).Layout;
}

<h1>Create a New Account</h1>
<p>
    &nbsp;
</p>

@using (Html.BeginForm("Create","Account",FormMethod.Post))
{
    @Html.ValidationSummary(true, "Account creation was unsuccessful. Please correct the errors and try again.")
    @Html.HiddenFor(model => model.UserId)
    @Html.HiddenFor(model => model.BusinessUnitId)
    @Html.Hidden("hdnRoleId")
    @Html.HiddenFor(model => model.RoleIds)
    <table width="90%" cellspacing="0" cellpadding="5" border="0">
    <tr>
        <td valign="top">
        <fieldset>
            <legend>Account Information</legend>
            @Html.HiddenFor(m => m.BusinessUnitId)

            <div class="editor-label">
                @Html.LabelFor(m => m.FirstName)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.FirstName)
                @Html.ValidationMessageFor(m => m.FirstName)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.LastName)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.LastName)
                @Html.ValidationMessageFor(m => m.LastName)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.Email)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.Email)
                @Html.ValidationMessageFor(m => m.Email) <br />Note: As an user of the system you will be automatically opted in to receive promotional materials via email.
            </div>
        </fieldset>
        </td>        
    </tr>
    <tr>
        <td colspan="2">
            <p>@ViewBag.CreateMessage</p>
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <input type="submit" value="Create User" /> |
            @Html.ActionLink("Back to Log On", "LogOn")
        </td>
    </tr>
    </table>
}
